<script setup lang="ts">
import { ElNotification } from "element-plus"
import {useTheme} from "@/hooks/useTheme"
import { reactive } from "vue"
import { useLang } from "@/hooks/useLang"
import zh from "element-plus/lib/locale/lang/zh-cn"
import en from "element-plus/lib/locale/lang/en"
import ja from "element-plus/lib/locale/lang/ja"

const { initTheme } = useTheme()
const { ActiveLangName } = useLang()

interface ILang {
  [key: string]: any
}


const langOptions:ILang = reactive({
  zhCn: zh,
  en: en,
  ja: ja
})

// 初始化主题
initTheme()

// 初始化语言
/** 将 Element Plus 的语言设置为中文 */
const locale = { name:ActiveLangName }

</script> 

<template>
  <ElConfigProvider :locale="langOptions[ActiveLangName]">
    <router-view />
  </ElConfigProvider>
</template>
